/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui.Almacen;

import Controlador.Bean.Almacen.Almacen;
import Controlador.Bean.Almacen.Producto;
import Controlador.Bean.Almacen.ProductoxAlmacen;
import Controlador.Bean.Almacen.ProdxSolicitudMovimiento;
import Controlador.Bean.Almacen.SolicitudMovimiento;
import gui.General.Main;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.table.AbstractTableModel;



/**
 *
 * @author César
 */
public class NuevaTransaccion extends javax.swing.JInternalFrame {

    String idAlm;
    List<Almacen> almacenes = Controlador.Service.Almacen.GestionAlmacenes.obtenerAlmacenes();
    int seleccionado=0;
    boolean eliminado1 = false;
    boolean eliminado2 = false;
    String origen;
    String destino;
    TableModel tm;
    
    /**
     * Creates new form NuevaTransaccion
     */
    public NuevaTransaccion(String id) {
        initComponents();
        idAlm = id;
        initComp(id);
    }

    public void initComp(String id){
        tm = new TableModel();
        tblProductos.setModel(tm);
        cmbOrigen.addItemListener(new ItemChangeListener1());
        cmbDestino.addItemListener(new ItemChangeListener2());
        cmbOrigen.removeAllItems();
        cmbDestino.removeAllItems();
        cmbOrigen.addItem("Seleccionar");
        cmbDestino.addItem("Seleccionar");
        for(int i=0; i<almacenes.size(); i++){            
            cmbOrigen.addItem(almacenes.get(i).getNombre());
            cmbDestino.addItem(almacenes.get(i).getNombre());
        }
        txtEncargado.setText(Main.usu.getNombUsuario());
    }
    
    private static NuevaTransaccion mynp = null;

    public static NuevaTransaccion getInstance(String idAlmacen) {
        if (mynp == null) {
            mynp = new NuevaTransaccion(idAlmacen);
            Main.getDesktop().add(mynp);
            mynp.setVisible(true);
            mynp.toFront();
        } else {
            if (mynp.isClosed() || !mynp.isVisible()) {
                mynp = new NuevaTransaccion(idAlmacen);
                Main.getDesktop().add(mynp);
                mynp.toFront();
                mynp.setVisible(true);
            } else {
                mynp.toFront();
            }
        }

        return mynp;
    } 
    
    
    public String obtenerNombreAlmacen(String id){
        for(int i=0; i<almacenes.size(); i++){
            if(almacenes.get(i).getIdAlmacen().compareTo(id)==0)
                return almacenes.get(i).getNombre();
        }
        return null;
    }
    
    public String obtenerIdAlmacen(String Nombre){
        for(int i=0; i<almacenes.size(); i++){
            if(almacenes.get(i).getNombre().compareTo(Nombre)==0)
                return almacenes.get(i).getIdAlmacen();
        }
        return null;
    }
    
    class ItemChangeListener1 implements ItemListener{
        @Override
        public void itemStateChanged(ItemEvent event) {
           if (event.getStateChange() == ItemEvent.SELECTED) {
              String item = (String)event.getItem();
              // do something with object
              String IdOr = obtenerNombreAlmacen(idAlm);
              if(item.compareTo("Seleccionar")!=0){
                  if(IdOr.compareTo(item)==0){
                      cmbDestino.removeItem(item);
                      eliminado2 = true;
                      seleccionado++;
                      origen = IdOr;
                  }else if(seleccionado == 0){
                      seleccionado++;
                      if(eliminado2==true){
                          cmbDestino.addItem(IdOr);
                          eliminado2=false;
                      }
                      cmbDestino.setSelectedItem(IdOr);
                      origen = item;
                      destino = IdOr;
                  }
                  seleccionado--;
              }
           }
        }       
    }
    
    class ItemChangeListener2 implements ItemListener{
        @Override
        public void itemStateChanged(ItemEvent event) {
           if (event.getStateChange() == ItemEvent.SELECTED) {
              String item = (String)event.getItem();
              // do something with object
              String IdOr = obtenerNombreAlmacen(idAlm);
              if(item.compareTo("Seleccionar")!=0){
                  if(IdOr.compareTo(item)==0){
                      cmbOrigen.removeItem(item);
                      eliminado1=true;
                      seleccionado++;
                      destino = IdOr;
                  }else if(seleccionado == 0){
                      seleccionado++;
                      if(eliminado1==true){
                          cmbOrigen.addItem(IdOr);
                          eliminado1=false;
                      }
                      cmbOrigen.setSelectedItem(IdOr);
                      destino = item;
                      origen = IdOr;
                  }
                  seleccionado--;
              }
           }
        }       
    }
    
    public boolean hayStock(String idProducto, Double cantidad){
        List<ProductoxAlmacen> data = (List)Controlador.Service.Almacen.GestionAlmacenes.obtenerProductosxAlmacen(idAlm, idProducto);
        Double aux;
        ProductoxAlmacen pAlm = data.get(0);
        aux = pAlm.getCantidad();
        if(aux>cantidad){
            return true;
        }else{
            return false;
        }
    }
    
    public void errorCantidad(){
        JOptionPane.showMessageDialog(this, "No hay suficiente stock en almacén");
    }
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    
    class prodcant{
        Producto producto;
        Double cantidad;
        
        public prodcant(Producto producto, Double cantidad){
            this.cantidad = cantidad;
            this.producto = producto;
        }
    }
    
    class TableModel extends AbstractTableModel{
              
        //Two arrays used for the table data
        String[] columnNames = {"Codigo Prod.", "Nombre del Producto", "Descripción"
                        , "Cantidad", "Unidad de Monto"};
               
        ArrayList<prodcant> data = new ArrayList<>();
        
        public void agregarProducto(Producto producto){
            boolean encontro = false;
            for(int i=0; i<data.size(); i++){
                if(data.get(i).producto.getIdProducto().compareTo(producto.getIdProducto())==0){
                    encontro = true;
                }
            }
            if(!encontro){
                data.add(new prodcant(producto,1.0));
            }
            fireTableDataChanged();
        }
        
        @Override
        public void setValueAt(Object aValue, int rowIndex, int columnIndex){
            if(aValue.toString().equals("0.0")){
                return;
            }
            if(hayStock(data.get(rowIndex).producto.getIdProducto(), Double.parseDouble(aValue.toString()))){
                data.get(rowIndex).cantidad = Double.parseDouble(aValue.toString());
                fireTableDataChanged(); 
            }else{
                errorCantidad();
            }
        }
        
        @Override
        public int getRowCount()
        {
            return data.size();
        }
        
        @Override
        public int getColumnCount()            
        {
            return columnNames.length;
        }
        
        @Override
        public Object getValueAt(int row, int column)
        {        
            switch(column){
                case 0: return data.get(row).producto.getIdProducto();
                case 1: return data.get(row).producto.getNombre();
                case 2: return data.get(row).producto.getDescripcion();
                case 3: return data.get(row).cantidad;
                default: return data.get(row).producto.getUnidadMetrica();
            }
        }
        
        //Used by the JTable object to set the column names
        @Override
        public String getColumnName(int column) {
            return columnNames[column];
        }
        
        //Used by the JTable object to render different
        //functionality based on the data type
        @Override
        public Class getColumnClass(int c) {
            return getValueAt(0, c).getClass();
        }
        
        @Override
        public boolean isCellEditable(int row, int column)
        {
           if (column != 3)
	   {
	        return false;
	   }
	   else
	   {
		return true;
	   }
        }
    }
    
    
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlDetalle = new javax.swing.JPanel();
        lblOrigen = new javax.swing.JLabel();
        txtEncargado = new javax.swing.JTextField();
        lblDestino = new javax.swing.JLabel();
        lblEncargado = new javax.swing.JLabel();
        lblMotivo = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        txtMotivo = new javax.swing.JTextArea();
        btnGuardar = new javax.swing.JButton();
        btnDescartar = new javax.swing.JButton();
        cmbOrigen = new javax.swing.JComboBox();
        cmbDestino = new javax.swing.JComboBox();
        pnlTabla = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblProductos = new javax.swing.JTable();
        btnAnadir = new javax.swing.JButton();
        btnEliminar = new javax.swing.JButton();

        setClosable(true);
        setMaximumSize(new java.awt.Dimension(600, 417));
        setMinimumSize(new java.awt.Dimension(600, 417));
        setPreferredSize(new java.awt.Dimension(600, 417));
        setRequestFocusEnabled(false);

        pnlDetalle.setBorder(javax.swing.BorderFactory.createTitledBorder("Detalle de la solicitud"));
        pnlDetalle.setMaximumSize(new java.awt.Dimension(515, 180));
        pnlDetalle.setMinimumSize(new java.awt.Dimension(515, 180));
        pnlDetalle.setName(""); // NOI18N
        pnlDetalle.setPreferredSize(new java.awt.Dimension(515, 180));

        lblOrigen.setText("Origen");

        txtEncargado.setEditable(false);

        lblDestino.setText("Destino");

        lblEncargado.setText("Encargado");

        lblMotivo.setText("Motivo de la transacción");

        txtMotivo.setColumns(10);
        txtMotivo.setRows(5);
        txtMotivo.setMaximumSize(new java.awt.Dimension(84, 94));
        txtMotivo.setMinimumSize(new java.awt.Dimension(84, 94));
        jScrollPane2.setViewportView(txtMotivo);

        btnGuardar.setText("Guardar");
        btnGuardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarActionPerformed(evt);
            }
        });

        btnDescartar.setText("Descartar");
        btnDescartar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDescartarActionPerformed(evt);
            }
        });

        cmbOrigen.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        cmbDestino.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout pnlDetalleLayout = new javax.swing.GroupLayout(pnlDetalle);
        pnlDetalle.setLayout(pnlDetalleLayout);
        pnlDetalleLayout.setHorizontalGroup(
            pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDetalleLayout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addGroup(pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblOrigen)
                    .addComponent(lblDestino)
                    .addComponent(lblEncargado))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtEncargado, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)
                    .addComponent(cmbOrigen, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cmbDestino, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(68, 68, 68)
                .addGroup(pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblMotivo)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlDetalleLayout.createSequentialGroup()
                .addContainerGap(180, Short.MAX_VALUE)
                .addComponent(btnGuardar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnDescartar)
                .addGap(216, 216, 216))
        );
        pnlDetalleLayout.setVerticalGroup(
            pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlDetalleLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblOrigen)
                    .addComponent(lblMotivo)
                    .addComponent(cmbOrigen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlDetalleLayout.createSequentialGroup()
                        .addGroup(pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblDestino)
                            .addComponent(cmbDestino, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtEncargado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblEncargado)))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(pnlDetalleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnGuardar)
                    .addComponent(btnDescartar))
                .addContainerGap(33, Short.MAX_VALUE))
        );

        pnlTabla.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        pnlTabla.setMaximumSize(new java.awt.Dimension(104, 104));
        pnlTabla.setMinimumSize(new java.awt.Dimension(104, 104));
        pnlTabla.setPreferredSize(new java.awt.Dimension(104, 104));
        pnlTabla.setLayout(new java.awt.BorderLayout());

        tblProductos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(tblProductos);

        pnlTabla.add(jScrollPane1, java.awt.BorderLayout.CENTER);

        btnAnadir.setText("Añadir");
        btnAnadir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAnadirActionPerformed(evt);
            }
        });

        btnEliminar.setText("Eliminar");
        btnEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEliminarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlDetalle, javax.swing.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE)
                    .addComponent(pnlTabla, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(btnAnadir)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnEliminar)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlDetalle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAnadir)
                    .addComponent(btnEliminar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlTabla, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        getAccessibleContext().setAccessibleDescription("");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnAnadirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAnadirActionPerformed
        // TODO add your handling code here:
        String selectedItem= ((String)cmbOrigen.getSelectedItem());
        if(selectedItem.equals("Seleccionar")){
            JOptionPane.showMessageDialog(this, "Debe seleccionar el Origen", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        AgregarProducto ap = new AgregarProducto(this);
        Main.getDesktop().add(ap);
        ap.setVisible(true);
    }//GEN-LAST:event_btnAnadirActionPerformed

    private void btnGuardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarActionPerformed
        // TODO add your handling code here:
        String selectedItem= ((String)cmbOrigen.getSelectedItem());
        if(selectedItem.equals("Seleccionar")){
            JOptionPane.showMessageDialog(this, "Debe seleccionar el Origen", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        selectedItem= ((String)cmbDestino.getSelectedItem());
        if(selectedItem.equals("Seleccionar")){
            JOptionPane.showMessageDialog(this, "Debe seleccionar el Destino", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(tm.data.isEmpty()){
            JOptionPane.showMessageDialog(this, "Debe agregar por lo menos un producto", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(cmbDestino.getSelectedIndex()!=0 && cmbOrigen.getSelectedIndex()!=0){
            int resultado = JOptionPane.showConfirmDialog(this, "¿Desea guardar los cambios?", "Confirmación", JOptionPane.YES_NO_OPTION);
            if(resultado == 0){
                Date fecha = new Date();
                String id1 = "";
                String id2 = "";
                SolicitudMovimiento sMovA = new SolicitudMovimiento("IdMov", Main.usu.getIdEmpleadoAdm(), idAlm, eliminado1?"Entrada":"Salida", fecha, txtMotivo.getText(), "1", "0");
                Controlador.Service.Almacen.GestionAlmacenes.agregarSolicitudMovimiento(sMovA);
                for(int i=0; i<almacenes.size(); i++){
                    if(almacenes.get(i).getNombre().equals(cmbOrigen.getSelectedItem()))
                        id1=almacenes.get(i).getIdAlmacen();
                    if(almacenes.get(i).getNombre().equals(cmbDestino.getSelectedItem()))
                        id2=almacenes.get(i).getIdAlmacen();
                }
                String idAlm2 = id1.equals(idAlm)?id2:id1;
                SolicitudMovimiento sMovB = new SolicitudMovimiento("IdMov", Main.usu.getIdEmpleadoAdm(), idAlm2, !eliminado1?"Entrada":"Salida", fecha, txtMotivo.getText(), "1", "0");
                Controlador.Service.Almacen.GestionAlmacenes.agregarSolicitudMovimiento(sMovB);
                List<ProdxSolicitudMovimiento> l1 = new ArrayList<>();
                List<ProdxSolicitudMovimiento> l2 = new ArrayList<>();
                for(int i=0; i<tm.data.size(); i++){
                    ProdxSolicitudMovimiento PxSolMov = new ProdxSolicitudMovimiento(tm.data.get(i).producto.getIdProducto(), sMovA.getIdSolicitudMovimiento(), tm.data.get(i).cantidad);
                    l1.add(PxSolMov);
                    ProdxSolicitudMovimiento PxSolMov1 = new ProdxSolicitudMovimiento(tm.data.get(i).producto.getIdProducto(), sMovB.getIdSolicitudMovimiento(), tm.data.get(i).cantidad);
                    l2.add(PxSolMov1);
                }
                Controlador.Service.Almacen.GestionAlmacenes.agregarProdxSolMov(l1, idAlm, eliminado1?"Entrada":"Salida");
                Controlador.Service.Almacen.GestionAlmacenes.agregarProdxSolMov(l2, idAlm2, eliminado1?"Entrada":"Salida");
                JOptionPane.showMessageDialog(this, "Se ha guardado correctamente", "Confirmación", JOptionPane.INFORMATION_MESSAGE);
                this.dispose();
            }
        }else{
            JOptionPane.showInternalMessageDialog(this, "Debe elegir el almacén de Origen y el de Destino");
        }
    }//GEN-LAST:event_btnGuardarActionPerformed

    private void btnDescartarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDescartarActionPerformed
        // TODO add your handling code here:
        int resultado = JOptionPane.showConfirmDialog(this, "¿Seguro que desea descartar la solicitud?");
        if(resultado== JOptionPane.OK_OPTION){
            this.dispose();
        }
    }//GEN-LAST:event_btnDescartarActionPerformed

    private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
        // TODO add your handling code here:
        tm.data.remove(tblProductos.getSelectedRow());
        tm.fireTableDataChanged();
    }//GEN-LAST:event_btnEliminarActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAnadir;
    private javax.swing.JButton btnDescartar;
    private javax.swing.JButton btnEliminar;
    private javax.swing.JButton btnGuardar;
    private javax.swing.JComboBox cmbDestino;
    private javax.swing.JComboBox cmbOrigen;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel lblDestino;
    private javax.swing.JLabel lblEncargado;
    private javax.swing.JLabel lblMotivo;
    private javax.swing.JLabel lblOrigen;
    private javax.swing.JPanel pnlDetalle;
    private javax.swing.JPanel pnlTabla;
    private javax.swing.JTable tblProductos;
    private javax.swing.JTextField txtEncargado;
    private javax.swing.JTextArea txtMotivo;
    // End of variables declaration//GEN-END:variables
}
